package com.woniuxy.yoga.business.dao.mapper;

import com.woniuxy.yoga.business.dao.model.BusinessAccount;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;

/**
 * <p>
 * 商家账号表 Mapper 接口
 * </p>
 *
 * @author 韦用文,刘存益,郎腾霄
 * @since 2023年11月30日
 */
@Mapper
public interface BusinessAccountMapper extends BaseMapper<BusinessAccount> {

    /**
     * 插入商家账号信息 将主键信息赋值给参数对象上
     * @param businessAccount
     * @return
     */
    @Insert("insert into business_account values(null,#{accountName},#{accountPhone},#{accountPassword},#{accountNickname},#{accountHeader},#{accountRealname},#{accountIdcard},#{accountRegisterTime},null,#{accountState})")
    @Options(useGeneratedKeys = true,keyProperty = "accountId",keyColumn = "account_id")
    Integer addAccount(BusinessAccount businessAccount);
}
